import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty } from "class-validator";
import { PageType } from "../entities/menu.entity";
import { DiffDto } from "src/common/dto/dto";

export class CreateMenuButtonDto extends DiffDto {
    /** 按钮名称 */
    @IsNotEmpty({ message: '按钮名称不能为空' })
    @ApiProperty({
        type: String,
        name: 'name',
        description: '按钮名称',
    })
    public readonly name: string;
    /** 按钮KEY */
    @IsNotEmpty({ message: '按钮KEY不能为空' })
    @ApiProperty({
        type: String,
        name: 'key',
        description: '按钮KEY',
    })
    public readonly key: string;

    /** 菜单ID */
    @IsNotEmpty({ message: '菜单ID不能为空' })
    @ApiProperty({
        type: Number,
        name: 'menuId',
        description: '菜单ID',
    })
    public readonly menuId: number;
}
export class UpdateMenuButtonDto extends CreateMenuButtonDto {
    @IsNotEmpty({ message: 'id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'id',
        description: 'id',
    })
    public readonly id: number;
}